<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserCoinLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_coin_log', function (Blueprint $table) {
            $table->increments('id')->unsigned()->comment('用户金币流水表');
            $table->integer('user_id')->unsigned()->comment('用户id');
            $table->integer('bussiness_id')->unsigned()->comment('业务id');
            $table->smallInteger('type')->unsigned()->comment('1: 小妖币，2: 金币');
            $table->decimal('coin', 10, 2)->default(0)->comment('金币值');
            $table->string('desc')->comment('描述');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_coin_log');
    }
}
